﻿/* JF 20110715 */

$(document).ready(function () {
    var target = $.getUrlVar('target');
    if (typeof (target) != "undefined") { jumpTo(target); } else { jumpTo(0); }
    $("ul.cNav li a").click(function () {
        jumpTo($("ul.cNav li a").index(this));
    }).hover(
            function () { $(this).addClass("hover"); },
            function () { $(this).removeClass("hover"); });
});

function jumpTo(index) {
    $(".cText").eq(index).fadeIn().siblings().hide();
}

$.extend({
    getUrlVars: function () {
        var vars = [], hash;
        var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
        for (var i = 0; i < hashes.length; i++) {
            hash = hashes[i].split('=');
            vars.push(hash[0]);
            vars[hash[0]] = hash[1];
        }
        return vars;
    }, getUrlVar: function (name) {
        return $.getUrlVars()[name];
    }
});